// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.

#include "UnrealTorch.h"

#include "ModuleManager.h"
#include "IPluginManager.h"


#include "WindowsTorch/Loader.h"


#define LOCTEXT_NAMESPACE "FUnrealTorchModule"




DEFINE_LOG_CATEGORY( LogUnrealTorch );








void FUnrealTorchModule::StartupModule()
{
	// This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module

	// Create dll loader and load dlls
	windowsTorchLoader = std::make_unique<WindowsTorchLoader>();
	check( windowsTorchLoader );
	windowsTorchLoader->loadDlls();
}




void FUnrealTorchModule::ShutdownModule()
{
	// This function may be called during shutdown to clean up your module.  For modules that support dynamic reloading,
	// we call this function before unloading the module.

	windowsTorchLoader.reset();    // will free dlls in destructor
}




#undef LOCTEXT_NAMESPACE

IMPLEMENT_MODULE(FUnrealTorchModule, UnrealTorch)
